<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
    $(function () {
        $("#view").on('click', function () {
            hideShowTableTd('countDrugTable', '0,2,3,4', '2');
            $("#LeftDiv").attr("class", "main-content col-lg-0");
            $("#RightDiv").show('normal');
            return loadDiv('rigthCenterDiv', '${ctx}/nurse/dispOrderDetails');
        });
    });
    function ordersDispPrint(){
        var dispDays = $("#days").val();
        var visitNo = $("#visitNo").val();
        printPdf('/nurse/dispIndexPrint','days=' +dispDays + '&visitNo=' +visitNo );
    }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-12" id="LeftDiv">
            <div class="content-wrap">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li><a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/nurse/index')">床位列表</a></li>
                        <li class="active">
                            <a href="#" >摆药查询</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchOrdersDisp" modelAttribute="orders"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchOrdersDisp','${ctx}/orders/orders/dispIndex');"
                                                   method="post" class="form-inline">
                                            <input type="number" min="1" id="days" size="3"
                                                   class="form-control input-sm spinner-input"
                                                   name="days" placeholder="请输入摆药天数" value="${orders.days}">
                                            <input type="number" min="1" class="form-control input-sm spinner-input"
                                                   name="visitNo" id="visitNo" placeholder="请输入病人住院号" value="${orders.visitNo}">
                                            <input class="btn btn-primary" type="submit" value="查询"/>
                                           <%-- <input id="dispSave" class="btn btn-primary" type="button" value="摆药保存"/>--%>
                                            <input id="view" class="btn btn-primary" type="button" value="详情"/>
                                            <input id="print" onclick="ordersDispPrint()" class="btn btn-primary" type="button" value="打印"/>
                                        </form:form>
                                    </div>
                                </div>
                                <%--药品汇总列表--%>
                                <table id="countDrugTable" class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>摆药天数</th>
                                        <th>药品名称</th>
                                        <th>包装规格</th>
                                        <th>包装单位</th>
                                        <th>药品厂商</th>
                                        <th>摆药数量</th>
                                        <th>库存量</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${countDrugList}" var="drug">
                                        <tr style="text-align: center;">

                                            <td>
                                            ${drug.days}
                                            </td>

                                            <td>
                                                    ${drug.drugName}
                                            </td>
                                            <td>
                                                    ${drug.drugSpec}
                                            </td>
                                            <td>
                                                    ${drug.drugUnits}
                                            </td>
                                            <td>
                                                    ${drug.firmName}
                                            </td>
                                            <td>
                                                    ${drug.amount}
                                            </td>
                                            <td>
                                                    ${drug.stock}(${drug.drugUnits})
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                <input type="hidden" id="dispNo" value="${orders.dispNo}">
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <%--右侧医嘱明细列表--%>
        <section class="main-content col-lg-12" style="display: none" id="RightDiv">
            <div class="content-wrap" id="rigthCenterDiv">
            </div>
        </section>
    </section>

</div>

